package org.jeecgframework.tag.core.plugin.tag;

import java.io.StringWriter;
import java.io.Writer;

import org.jeecgframework.tag.core.base.TagEnum;
import org.jeecgframework.tag.core.error.ParseRuntimeException;
import org.jeecgframework.tag.core.plugin.vo.AutocompleteTagModel;
import org.jeecgframework.tag.core.util.FreemarkUtil;

/**
 * 自动完成标签
 * @author JueYue
 * @date 2014年12月2日 下午10:45:33
 * @version 2.0
 */
public class AutocompleteTag extends AutocompleteTagModel {

    private static final long serialVersionUID = 1L;

    @Override
    public String parseTag() {
        Writer write = new StringWriter();
        try {
            FreemarkUtil.getTemplate(TagEnum.Autocomplete).process(this, write);
        } catch (Exception e) {
            throw new ParseRuntimeException("AutocompleteTag 文本解析异常", e.fillInStackTrace());
        }
        return write.toString();
    }

}
